package com.iretailer.report.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Auther Bennie
 * @Date 2020/6/19 17:28
 * @Description
 */
@TableName(value = "d_cameras")
@Accessors(chain = true)
@Data
public class Camera {

    @TableId(value = "Id", type = IdType.AUTO)
    @JSONField(name = "Id")
    private Long id;

    @JSONField(name = "DeviceId")
    @TableField(value = "DeviceId")
    private String deviceId;

    @JSONField(name = "DeviceName")
    @TableField(value = "DeviceName")
    private String deviceName;

    @JSONField(name = "IpAddress")
    @TableField(value = "IpAddress")
    private String ipAddress;

    @JSONField(name = "MacAddress")
    @TableField(value = "MacAddress")
    private String macAddress;

    @JSONField(name = "LastDataTime", format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "LastDataTime")
    private LocalDateTime lastDataTime;

    @JSONField(name = "MallId")
    @TableField(value = "MallId")
    private String mallId;

    @JSONField(name = "SerialNumber")
    @TableField(value = "SerialNumber")
    private String serialNumber;

    @JSONField(name = "DeviceType")
    @TableField(value = "DeviceType")
    private String deviceType;

    @JSONField(name = "UpdateTime", format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "UpdateTime")
    private LocalDateTime updateTime;

    @JSONField(name = "UpdateUser")
    @TableField(value = "UpdateUser")
    private String updateUser;

    /**
     * -1 表示不可用
     * 1 表示可用
     */
    @JSONField(name = "Enabled")
    @TableField(value = "Enabled")
    private Integer enabled = 0;

    @JSONField(name = "Position")
    @TableField(value = "Position")
    private String Position;

    @JSONField(name = "ZoneCount")
    @TableField(value = "ZoneCount")
    private Integer ZoneCount;

    @JSONField(name = "CreateTime")
    @TableField(value = "CreateTime")
    private LocalDateTime createTime;

    @JSONField
    @TableField(exist = false)
    private List<CameraZone> cameraZones;


}
